/*
day100_2
2019.12.6
*/
#include<stdlib.h>

struct TreeNode {
	int val;
	struct TreeNode *left;
	struct TreeNode *right;
	TreeNode (int x) : val(x),left(NULL),right(NULL){}
};

class Solution{
public:
    TreeNode* pruneTree(TreeNode* root) {
        if(!root) return root;
        
        
        pruneTree(root->left);
        pruneTree(root->right);
        
        
        if(root->left && root->left->val==0 && !root->left->left && !root->left->right)
        {
        	root->left=NULL;
		}
		
		if(root->right && root->right->val==0 && !root->right->left && !root->right->right)
        {
        	root->right=NULL;
		}
		
		
		return root;
    }
};
int main()
{
	
	return 0;
}
